const app = getApp()

Page({
	onLoad() {
		// this.getUserInfo()
	},

	getUserInfo(e) {
		// app.getUserInfo().then(user => {
		// 	this.setData({
		// 		user
		// 	})
		// })
		if (e.detail.userInfo) {
			this.setData({ user: e.detail.userInfo })
		} else {
			wx.showToast({
				title: '登录失败', icon: 'none'
			})
		}
	},
	modalcnt: function () {
		wx.showModal({
			title: '提示',
			content: '敬请期待',
			success: function (res) {
				if (res.confirm) {
					console.log('用户点击确定')
				} else if (res.cancel) {
					console.log('用户点击取消')
				}
			}
		})
	},
	
	onShareAppMessage() {
		const { shareTitle, shareCover } = app.globalData.config
		return {
			title: shareTitle,
			imageUrl: shareCover,
			path: '/pages/entry/entry'
		}
	}
})